(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^3).


The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(m)) → false
eq(s(n), 0) → false
eq(s(n), s(m)) → eq(n, m)
le(0, m) → true
le(s(n), 0) → false
le(s(n), s(m)) → le(n, m)
min(cons(x, nil)) → x
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x)))
if_min(true, cons(n, cons(m, x))) → min(cons(n, x))
if_min(false, cons(n, cons(m, x))) → min(cons(m, x))
replace(n, m, nil) → nil
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x))
if_replace(true, n, m, cons(k, x)) → cons(m, x)
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x))
empty(nil) → true
empty(cons(n, x)) → false
head(cons(n, x)) → n
tail(nil) → nil
tail(cons(n, x)) → x
sort(x) → sortIter(x, nil)
sortIter(x, y) → if(empty(x), x, y, append(y, cons(min(x), nil)))
if(true, x, y, z) → y
if(false, x, y, z) → sortIter(replace(min(x), head(x), tail(x)), z)

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^3).


The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(x, nil)) → x [1]
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x))) [1]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x)) [1]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
empty(nil) → true [1]
empty(cons(n, x)) → false [1]
head(cons(n, x)) → n [1]
tail(nil) → nil [1]
tail(cons(n, x)) → x [1]
sort(x) → sortIter(x, nil) [1]
sortIter(x, y) → if(empty(x), x, y, append(y, cons(min(x), nil))) [1]
if(true, x, y, z) → y [1]
if(false, x, y, z) → sortIter(replace(min(x), head(x), tail(x)), z) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(x, nil)) → x [1]
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x))) [1]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x)) [1]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
empty(nil) → true [1]
empty(cons(n, x)) → false [1]
head(cons(n, x)) → n [1]
tail(nil) → nil [1]
tail(cons(n, x)) → x [1]
sort(x) → sortIter(x, nil) [1]
sortIter(x, y) → if(empty(x), x, y, append(y, cons(min(x), nil))) [1]
if(true, x, y, z) → y [1]
if(false, x, y, z) → sortIter(replace(min(x), head(x), tail(x)), z) [1]

The TRS has the following type information:
eq :: 0:s → 0:s → true:false
0 :: 0:s
true :: true:false
s :: 0:s → 0:s
false :: true:false
le :: 0:s → 0:s → true:false
min :: nil:cons:append → 0:s
cons :: 0:s → nil:cons:append → nil:cons:append
nil :: nil:cons:append
if_min :: true:false → nil:cons:append → 0:s
replace :: 0:s → 0:s → nil:cons:append → nil:cons:append
if_replace :: true:false → 0:s → 0:s → nil:cons:append → nil:cons:append
empty :: nil:cons:append → true:false
head :: nil:cons:append → 0:s
tail :: nil:cons:append → nil:cons:append
sort :: nil:cons:append → nil:cons:append
sortIter :: nil:cons:append → nil:cons:append → nil:cons:append
if :: true:false → nil:cons:append → nil:cons:append → nil:cons:append → nil:cons:append
append :: nil:cons:append → nil:cons:append → nil:cons:append

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


sort
sortIter
if

(c) The following functions are completely defined:

empty
min
replace
head
tail
eq
le
if_replace
if_min

Due to the following rules being added:

empty(v0) → null_empty [0]
min(v0) → 0 [0]
replace(v0, v1, v2) → nil [0]
head(v0) → 0 [0]
tail(v0) → nil [0]
if_replace(v0, v1, v2, v3) → nil [0]
if_min(v0, v1) → 0 [0]

And the following fresh constants:

null_empty

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(x, nil)) → x [1]
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x))) [1]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x)) [1]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
empty(nil) → true [1]
empty(cons(n, x)) → false [1]
head(cons(n, x)) → n [1]
tail(nil) → nil [1]
tail(cons(n, x)) → x [1]
sort(x) → sortIter(x, nil) [1]
sortIter(x, y) → if(empty(x), x, y, append(y, cons(min(x), nil))) [1]
if(true, x, y, z) → y [1]
if(false, x, y, z) → sortIter(replace(min(x), head(x), tail(x)), z) [1]
empty(v0) → null_empty [0]
min(v0) → 0 [0]
replace(v0, v1, v2) → nil [0]
head(v0) → 0 [0]
tail(v0) → nil [0]
if_replace(v0, v1, v2, v3) → nil [0]
if_min(v0, v1) → 0 [0]

The TRS has the following type information:
eq :: 0:s → 0:s → true:false:null_empty
0 :: 0:s
true :: true:false:null_empty
s :: 0:s → 0:s
false :: true:false:null_empty
le :: 0:s → 0:s → true:false:null_empty
min :: nil:cons:append → 0:s
cons :: 0:s → nil:cons:append → nil:cons:append
nil :: nil:cons:append
if_min :: true:false:null_empty → nil:cons:append → 0:s
replace :: 0:s → 0:s → nil:cons:append → nil:cons:append
if_replace :: true:false:null_empty → 0:s → 0:s → nil:cons:append → nil:cons:append
empty :: nil:cons:append → true:false:null_empty
head :: nil:cons:append → 0:s
tail :: nil:cons:append → nil:cons:append
sort :: nil:cons:append → nil:cons:append
sortIter :: nil:cons:append → nil:cons:append → nil:cons:append
if :: true:false:null_empty → nil:cons:append → nil:cons:append → nil:cons:append → nil:cons:append
append :: nil:cons:append → nil:cons:append → nil:cons:append
null_empty :: true:false:null_empty

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

eq(0, 0) → true [1]
eq(0, s(m)) → false [1]
eq(s(n), 0) → false [1]
eq(s(n), s(m)) → eq(n, m) [1]
le(0, m) → true [1]
le(s(n), 0) → false [1]
le(s(n), s(m)) → le(n, m) [1]
min(cons(x, nil)) → x [1]
min(cons(0, cons(m, x))) → if_min(true, cons(0, cons(m, x))) [2]
min(cons(s(n'), cons(0, x))) → if_min(false, cons(s(n'), cons(0, x))) [2]
min(cons(s(n''), cons(s(m'), x))) → if_min(le(n'', m'), cons(s(n''), cons(s(m'), x))) [2]
if_min(true, cons(n, cons(m, x))) → min(cons(n, x)) [1]
if_min(false, cons(n, cons(m, x))) → min(cons(m, x)) [1]
replace(n, m, nil) → nil [1]
replace(0, m, cons(0, x)) → if_replace(true, 0, m, cons(0, x)) [2]
replace(0, m, cons(s(m''), x)) → if_replace(false, 0, m, cons(s(m''), x)) [2]
replace(s(n1), m, cons(0, x)) → if_replace(false, s(n1), m, cons(0, x)) [2]
replace(s(n2), m, cons(s(m1), x)) → if_replace(eq(n2, m1), s(n2), m, cons(s(m1), x)) [2]
if_replace(true, n, m, cons(k, x)) → cons(m, x) [1]
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x)) [1]
empty(nil) → true [1]
empty(cons(n, x)) → false [1]
head(cons(n, x)) → n [1]
tail(nil) → nil [1]
tail(cons(n, x)) → x [1]
sort(x) → sortIter(x, nil) [1]
sortIter(nil, y) → if(true, nil, y, append(y, cons(0, nil))) [2]
sortIter(cons(n3, nil), y) → if(false, cons(n3, nil), y, append(y, cons(n3, nil))) [3]
sortIter(cons(n3, cons(m2, x'')), y) → if(false, cons(n3, cons(m2, x'')), y, append(y, cons(if_min(le(n3, m2), cons(n3, cons(m2, x''))), nil))) [3]
sortIter(cons(n3, x'), y) → if(false, cons(n3, x'), y, append(y, cons(0, nil))) [2]
sortIter(cons(x1, nil), y) → if(null_empty, cons(x1, nil), y, append(y, cons(x1, nil))) [2]
sortIter(cons(n4, cons(m3, x2)), y) → if(null_empty, cons(n4, cons(m3, x2)), y, append(y, cons(if_min(le(n4, m3), cons(n4, cons(m3, x2))), nil))) [2]
sortIter(x, y) → if(null_empty, x, y, append(y, cons(0, nil))) [1]
if(true, x, y, z) → y [1]
if(false, cons(x3, nil), y, z) → sortIter(replace(x3, x3, nil), z) [4]
if(false, cons(x3, nil), y, z) → sortIter(replace(x3, x3, nil), z) [3]
if(false, cons(x3, nil), y, z) → sortIter(replace(x3, 0, nil), z) [3]
if(false, cons(x3, nil), y, z) → sortIter(replace(x3, 0, nil), z) [2]
if(false, cons(n5, cons(m4, x4)), y, z) → sortIter(replace(if_min(le(n5, m4), cons(n5, cons(m4, x4))), n5, cons(m4, x4)), z) [4]
if(false, cons(n5, cons(m4, x4)), y, z) → sortIter(replace(if_min(le(n5, m4), cons(n5, cons(m4, x4))), n5, nil), z) [3]
if(false, cons(n5, cons(m4, x4)), y, z) → sortIter(replace(if_min(le(n5, m4), cons(n5, cons(m4, x4))), 0, cons(m4, x4)), z) [3]
if(false, cons(n5, cons(m4, x4)), y, z) → sortIter(replace(if_min(le(n5, m4), cons(n5, cons(m4, x4))), 0, nil), z) [2]
if(false, cons(n6, x5), y, z) → sortIter(replace(0, n6, x5), z) [3]
if(false, cons(n6, x5), y, z) → sortIter(replace(0, n6, nil), z) [2]
if(false, nil, y, z) → sortIter(replace(0, 0, nil), z) [2]
if(false, cons(n7, x6), y, z) → sortIter(replace(0, 0, x6), z) [2]
if(false, x, y, z) → sortIter(replace(0, 0, nil), z) [1]
empty(v0) → null_empty [0]
min(v0) → 0 [0]
replace(v0, v1, v2) → nil [0]
head(v0) → 0 [0]
tail(v0) → nil [0]
if_replace(v0, v1, v2, v3) → nil [0]
if_min(v0, v1) → 0 [0]

The TRS has the following type information:
eq :: 0:s → 0:s → true:false:null_empty
0 :: 0:s
true :: true:false:null_empty
s :: 0:s → 0:s
false :: true:false:null_empty
le :: 0:s → 0:s → true:false:null_empty
min :: nil:cons:append → 0:s
cons :: 0:s → nil:cons:append → nil:cons:append
nil :: nil:cons:append
if_min :: true:false:null_empty → nil:cons:append → 0:s
replace :: 0:s → 0:s → nil:cons:append → nil:cons:append
if_replace :: true:false:null_empty → 0:s → 0:s → nil:cons:append → nil:cons:append
empty :: nil:cons:append → true:false:null_empty
head :: nil:cons:append → 0:s
tail :: nil:cons:append → nil:cons:append
sort :: nil:cons:append → nil:cons:append
sortIter :: nil:cons:append → nil:cons:append → nil:cons:append
if :: true:false:null_empty → nil:cons:append → nil:cons:append → nil:cons:append → nil:cons:append
append :: nil:cons:append → nil:cons:append → nil:cons:append
null_empty :: true:false:null_empty

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
true => 2
false => 1
nil => 0
null_empty => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: v0 >= 0, z' = v0
eq(z', z'') -{ 1 }→ eq(n, m) :|: n >= 0, z'' = 1 + m, z' = 1 + n, m >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 1 + m, z' = 0, m >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, n >= 0, z' = 1 + n
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: v0 >= 0, z' = v0
if(z', z'', z1, z2) -{ 1 }→ y :|: z1 = y, z >= 0, z' = 2, z2 = z, x >= 0, y >= 0, z'' = x
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(x3, x3, 0), z) :|: z1 = y, z >= 0, z2 = z, y >= 0, z' = 1, z'' = 1 + x3 + 0, x3 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(x3, x3, 0), z) :|: z1 = y, z >= 0, z2 = z, y >= 0, z' = 1, z'' = 1 + x3 + 0, x3 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(x3, 0, 0), z) :|: z1 = y, z >= 0, z2 = z, y >= 0, z' = 1, z'' = 1 + x3 + 0, x3 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(x3, 0, 0), z) :|: z1 = y, z >= 0, z2 = z, y >= 0, z' = 1, z'' = 1 + x3 + 0, x3 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z) :|: z1 = y, x4 >= 0, z >= 0, z2 = z, y >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z) :|: z1 = y, x4 >= 0, z >= 0, z2 = z, y >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z) :|: z1 = y, x4 >= 0, z >= 0, z2 = z, y >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z) :|: z1 = y, x4 >= 0, z >= 0, z2 = z, y >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z) :|: z1 = y, x5 >= 0, z >= 0, z2 = z, n6 >= 0, y >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z) :|: z1 = y, x5 >= 0, z >= 0, z2 = z, n6 >= 0, y >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z) :|: z1 = y, z >= 0, z'' = 1 + n7 + x6, z2 = z, n7 >= 0, y >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z) :|: z'' = 0, z1 = y, z >= 0, z2 = z, y >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z2 = v3, v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, v3 >= 0, z' = v0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(n, m, x) :|: n >= 0, z'' = n, z1 = m, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, m >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + m + x :|: n >= 0, z'' = n, z' = 2, z1 = m, z2 = 1 + k + x, x >= 0, k >= 0, m >= 0
le(z', z'') -{ 1 }→ le(n, m) :|: n >= 0, z'' = 1 + m, z' = 1 + n, m >= 0
le(z', z'') -{ 1 }→ 2 :|: z'' = m, z' = 0, m >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, n >= 0, z' = 1 + n
min(z') -{ 1 }→ x :|: x >= 0, z' = 1 + x + 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: v0 >= 0, z' = v0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(n2, m1), 1 + n2, m, 1 + (1 + m1) + x) :|: x >= 0, n2 >= 0, m1 >= 0, z'' = m, z' = 1 + n2, z1 = 1 + (1 + m1) + x, m >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, m, 1 + 0 + x) :|: z1 = 1 + 0 + x, x >= 0, z'' = m, z' = 0, m >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, m, 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z'' = m, z' = 0, m >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + n1, m, 1 + 0 + x) :|: z1 = 1 + 0 + x, x >= 0, n1 >= 0, z' = 1 + n1, z'' = m, m >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: n >= 0, z1 = 0, z' = n, z'' = m, m >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, z' = v0
sort(z') -{ 1 }→ sortIter(x, 0) :|: z' = x, x >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, y, 1 + y + (1 + 0 + 0)) :|: z'' = y, y >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', y, 1 + y + (1 + 0 + 0)) :|: z' = 1 + n3 + x', z'' = y, x' >= 0, y >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + 0, y, 1 + y + (1 + n3 + 0)) :|: z'' = y, y >= 0, z' = 1 + n3 + 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), y, 1 + y + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' = y, y >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 1 }→ if(0, x, y, 1 + y + (1 + 0 + 0)) :|: z' = x, z'' = y, x >= 0, y >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), y, 1 + y + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' = y, y >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + x1 + 0, y, 1 + y + (1 + x1 + 0)) :|: x1 >= 0, z'' = y, y >= 0, z' = 1 + x1 + 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: v0 >= 0, z' = v0

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ empty }
{ le }
{ eq }
{ tail }
{ head }
{ min, if_min }
{ replace, if_replace }
{ sortIter, if }
{ sort }

(14) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {empty}, {le}, {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: empty
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 2

(16) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {empty}, {le}, {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: ?, size: O(1) [2]

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: empty
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(18) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {le}, {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {le}, {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: le
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 2

(22) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {le}, {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: ?, size: O(1) [2]

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: le
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z''

(24) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(if_min(le(n5, m4), 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 }→ le(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 2 }→ if_min(le(n'', m'), 1 + (1 + n'') + (1 + (1 + m') + x)) :|: z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 3 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(le(n3, m2), 1 + n3 + (1 + m2 + x'')) + 0)) :|: z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(le(n4, m3), 1 + n4 + (1 + m3 + x2)) + 0)) :|: n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: eq
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 2

(28) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {eq}, {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: ?, size: O(1) [2]

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: eq
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z''

(30) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 }→ eq(z' - 1, z'' - 1) :|: z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(eq(z' - 1, m1), 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]

(31) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(32) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: tail
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'

(34) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {tail}, {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: ?, size: O(n1) [z']

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: tail
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(36) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']

(37) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(38) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']

(39) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: head
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'

(40) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {head}, {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: ?, size: O(n1) [z']

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: head
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(42) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']

(43) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(44) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']

(45) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: min
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'

Computed SIZE bound using KoAT for: if_min
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z''

(46) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {min,if_min}, {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: ?, size: O(n1) [z']
if_min: runtime: ?, size: O(n1) [z'']

(47) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: min
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 5 + 4·z' + z'2

Computed RUNTIME bound using KoAT for: if_min
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 22 + 24·z'' + 8·z''2

(48) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 5 + m4 }→ sortIter(replace(if_min(s2, 1 + n5 + (1 + m4 + x4)), n5, 1 + m4 + x4), z2) :|: s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s3, 1 + n5 + (1 + m4 + x4)), n5, 0), z2) :|: s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 4 + m4 }→ sortIter(replace(if_min(s4, 1 + n5 + (1 + m4 + x4)), 0, 1 + m4 + x4), z2) :|: s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 + m4 }→ sortIter(replace(if_min(s5, 1 + n5 + (1 + m4 + x4)), 0, 0), z2) :|: s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 1 }→ min(1 + m + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 1 }→ min(1 + n + x) :|: z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 3 + m' }→ if_min(s', 1 + (1 + n'') + (1 + (1 + m') + x)) :|: s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 2 }→ if_min(2, 1 + 0 + (1 + m + x)) :|: x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 2 }→ if_min(1, 1 + (1 + n') + (1 + 0 + x)) :|: z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 4 + m2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + if_min(s'', 1 + n3 + (1 + m2 + x'')) + 0)) :|: s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 3 + m3 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + if_min(s1, 1 + n4 + (1 + m3 + x2)) + 0)) :|: s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']

(49) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(50) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 107 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s15, n5, 1 + m4 + x4), z2) :|: s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 106 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s16, n5, 0), z2) :|: s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 106 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s17, 0, 1 + m4 + x4), z2) :|: s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 105 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s18, 0, 0), z2) :|: s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 106 + 57·m2 + 16·m2·n3 + 16·m2·x'' + 8·m22 + 56·n3 + 16·n3·x'' + 8·n32 + 56·x'' + 8·x''2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + s13 + 0)) :|: s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 105 + 57·m3 + 16·m3·n4 + 16·m3·x2 + 8·m32 + 56·n4 + 16·n4·x2 + 8·n42 + 56·x2 + 8·x22 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + s14 + 0)) :|: s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']

(51) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z'' + z1

Computed SIZE bound using CoFloCo for: if_replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z1 + z2

(52) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 107 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s15, n5, 1 + m4 + x4), z2) :|: s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 106 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s16, n5, 0), z2) :|: s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 106 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s17, 0, 1 + m4 + x4), z2) :|: s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 105 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s18, 0, 0), z2) :|: s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 106 + 57·m2 + 16·m2·n3 + 16·m2·x'' + 8·m22 + 56·n3 + 16·n3·x'' + 8·n32 + 56·x'' + 8·x''2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + s13 + 0)) :|: s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 105 + 57·m3 + 16·m3·n4 + 16·m3·x2 + 8·m32 + 56·n4 + 16·n4·x2 + 8·n42 + 56·x2 + 8·x22 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + s14 + 0)) :|: s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {replace,if_replace}, {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: ?, size: O(n1) [z'' + z1]
if_replace: runtime: ?, size: O(n1) [z1 + z2]

(53) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 6 + 4·z1 + z12

Computed RUNTIME bound using KoAT for: if_replace
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 8 + 4·z2 + z22

(54) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 107 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s15, n5, 1 + m4 + x4), z2) :|: s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 106 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s16, n5, 0), z2) :|: s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 106 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s17, 0, 1 + m4 + x4), z2) :|: s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 105 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(replace(s18, 0, 0), z2) :|: s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(0, n6, x5), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, n6, 0), z2) :|: x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, x6), z2) :|: z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(0, 0, 0), z2) :|: z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ sortIter(replace(0, 0, 0), z2) :|: z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 2 }→ sortIter(replace(z'' - 1, 0, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 4 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 3 }→ sortIter(replace(z'' - 1, z'' - 1, 0), z2) :|: z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + k + replace(z'', z1, x) :|: z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 3 + m1 }→ if_replace(s7, 1 + (z' - 1), z'', 1 + (1 + m1) + x) :|: s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(2, 0, z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 0, z'', 1 + (1 + m'') + x) :|: m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 2 }→ if_replace(1, 1 + (z' - 1), z'', 1 + 0 + (z1 - 1)) :|: z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 106 + 57·m2 + 16·m2·n3 + 16·m2·x'' + 8·m22 + 56·n3 + 16·n3·x'' + 8·n32 + 56·x'' + 8·x''2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + s13 + 0)) :|: s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 105 + 57·m3 + 16·m3·n4 + 16·m3·x2 + 8·m32 + 56·n4 + 16·n4·x2 + 8·n42 + 56·x2 + 8·x22 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + s14 + 0)) :|: s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]

(55) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(56) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 10 }→ sortIter(s24, z2) :|: s24 >= 0, s24 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 9 }→ sortIter(s25, z2) :|: s25 >= 0, s25 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 9 }→ sortIter(s26, z2) :|: s26 >= 0, s26 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 8 }→ sortIter(s27, z2) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 118 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 62·x4 + 9·x42 }→ sortIter(s28, z2) :|: s28 >= 0, s28 <= 1 * n5 + 1 * (1 + m4 + x4), s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 112 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(s29, z2) :|: s29 >= 0, s29 <= 1 * n5 + 1 * 0, s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 117 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 62·x4 + 9·x42 }→ sortIter(s30, z2) :|: s30 >= 0, s30 <= 1 * 0 + 1 * (1 + m4 + x4), s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 111 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(s31, z2) :|: s31 >= 0, s31 <= 1 * 0 + 1 * 0, s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 9 + 4·x5 + x52 }→ sortIter(s32, z2) :|: s32 >= 0, s32 <= 1 * n6 + 1 * x5, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 8 }→ sortIter(s33, z2) :|: s33 >= 0, s33 <= 1 * n6 + 1 * 0, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 8 }→ sortIter(s34, z2) :|: s34 >= 0, s34 <= 1 * 0 + 1 * 0, z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 8 + 4·x6 + x62 }→ sortIter(s35, z2) :|: s35 >= 0, s35 <= 1 * 0 + 1 * x6, z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 7 }→ sortIter(s36, z2) :|: s36 >= 0, s36 <= 1 * 0 + 1 * 0, z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 7 + 4·x + x2 }→ 1 + k + s23 :|: s23 >= 0, s23 <= 1 * z1 + 1 * x, z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s19 :|: s19 >= 0, s19 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s20 :|: s20 >= 0, s20 <= 1 * z'' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s21 :|: s21 >= 0, s21 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s22 :|: s22 >= 0, s22 <= 1 * z'' + 1 * (1 + (1 + m1) + x), s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 106 + 57·m2 + 16·m2·n3 + 16·m2·x'' + 8·m22 + 56·n3 + 16·n3·x'' + 8·n32 + 56·x'' + 8·x''2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + s13 + 0)) :|: s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 105 + 57·m3 + 16·m3·n4 + 16·m3·x2 + 8·m32 + 56·n4 + 16·n4·x2 + 8·n42 + 56·x2 + 8·x22 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + s14 + 0)) :|: s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]

(57) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: sortIter
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 2·z' + z'2 + z''

Computed SIZE bound using PUBS for: if
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 8 + 6·z'' + z''2 + z1 + z2

(58) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 10 }→ sortIter(s24, z2) :|: s24 >= 0, s24 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 9 }→ sortIter(s25, z2) :|: s25 >= 0, s25 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 9 }→ sortIter(s26, z2) :|: s26 >= 0, s26 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 8 }→ sortIter(s27, z2) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 118 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 62·x4 + 9·x42 }→ sortIter(s28, z2) :|: s28 >= 0, s28 <= 1 * n5 + 1 * (1 + m4 + x4), s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 112 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(s29, z2) :|: s29 >= 0, s29 <= 1 * n5 + 1 * 0, s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 117 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 62·x4 + 9·x42 }→ sortIter(s30, z2) :|: s30 >= 0, s30 <= 1 * 0 + 1 * (1 + m4 + x4), s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 111 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(s31, z2) :|: s31 >= 0, s31 <= 1 * 0 + 1 * 0, s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 9 + 4·x5 + x52 }→ sortIter(s32, z2) :|: s32 >= 0, s32 <= 1 * n6 + 1 * x5, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 8 }→ sortIter(s33, z2) :|: s33 >= 0, s33 <= 1 * n6 + 1 * 0, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 8 }→ sortIter(s34, z2) :|: s34 >= 0, s34 <= 1 * 0 + 1 * 0, z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 8 + 4·x6 + x62 }→ sortIter(s35, z2) :|: s35 >= 0, s35 <= 1 * 0 + 1 * x6, z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 7 }→ sortIter(s36, z2) :|: s36 >= 0, s36 <= 1 * 0 + 1 * 0, z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 7 + 4·x + x2 }→ 1 + k + s23 :|: s23 >= 0, s23 <= 1 * z1 + 1 * x, z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s19 :|: s19 >= 0, s19 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s20 :|: s20 >= 0, s20 <= 1 * z'' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s21 :|: s21 >= 0, s21 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s22 :|: s22 >= 0, s22 <= 1 * z'' + 1 * (1 + (1 + m1) + x), s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 106 + 57·m2 + 16·m2·n3 + 16·m2·x'' + 8·m22 + 56·n3 + 16·n3·x'' + 8·n32 + 56·x'' + 8·x''2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + s13 + 0)) :|: s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 105 + 57·m3 + 16·m3·n4 + 16·m3·x2 + 8·m32 + 56·n4 + 16·n4·x2 + 8·n42 + 56·x2 + 8·x22 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + s14 + 0)) :|: s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {sortIter,if}, {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]
sortIter: runtime: ?, size: O(n2) [2·z' + z'2 + z'']
if: runtime: ?, size: O(n2) [8 + 6·z'' + z''2 + z1 + z2]

(59) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: sortIter
after applying outer abstraction to obtain an ITS,
resulting in: O(n3) with polynomial bound: 252 + 2874·z' + 3556·z'2 + 1450·z'3

Computed RUNTIME bound using KoAT for: if
after applying outer abstraction to obtain an ITS,
resulting in: O(n3) with polynomial bound: 19048 + 86982·z'' + 127968·z''2 + 69600·z''3

(60) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if(z', z'', z1, z2) -{ 10 }→ sortIter(s24, z2) :|: s24 >= 0, s24 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 9 }→ sortIter(s25, z2) :|: s25 >= 0, s25 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 9 }→ sortIter(s26, z2) :|: s26 >= 0, s26 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 8 }→ sortIter(s27, z2) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 118 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 62·x4 + 9·x42 }→ sortIter(s28, z2) :|: s28 >= 0, s28 <= 1 * n5 + 1 * (1 + m4 + x4), s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 112 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(s29, z2) :|: s29 >= 0, s29 <= 1 * n5 + 1 * 0, s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 117 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 62·x4 + 9·x42 }→ sortIter(s30, z2) :|: s30 >= 0, s30 <= 1 * 0 + 1 * (1 + m4 + x4), s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 111 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 56·x4 + 8·x42 }→ sortIter(s31, z2) :|: s31 >= 0, s31 <= 1 * 0 + 1 * 0, s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 9 + 4·x5 + x52 }→ sortIter(s32, z2) :|: s32 >= 0, s32 <= 1 * n6 + 1 * x5, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 8 }→ sortIter(s33, z2) :|: s33 >= 0, s33 <= 1 * n6 + 1 * 0, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 8 }→ sortIter(s34, z2) :|: s34 >= 0, s34 <= 1 * 0 + 1 * 0, z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 8 + 4·x6 + x62 }→ sortIter(s35, z2) :|: s35 >= 0, s35 <= 1 * 0 + 1 * x6, z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 7 }→ sortIter(s36, z2) :|: s36 >= 0, s36 <= 1 * 0 + 1 * 0, z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 7 + 4·x + x2 }→ 1 + k + s23 :|: s23 >= 0, s23 <= 1 * z1 + 1 * x, z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s19 :|: s19 >= 0, s19 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s20 :|: s20 >= 0, s20 <= 1 * z'' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s21 :|: s21 >= 0, s21 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s22 :|: s22 >= 0, s22 <= 1 * z'' + 1 * (1 + (1 + m1) + x), s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 1 }→ sortIter(z', 0) :|: z' >= 0
sortIter(z', z'') -{ 2 }→ if(2, 0, z'', 1 + z'' + (1 + 0 + 0)) :|: z'' >= 0, z' = 0
sortIter(z', z'') -{ 2 }→ if(1, 1 + n3 + x', z'', 1 + z'' + (1 + 0 + 0)) :|: z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 106 + 57·m2 + 16·m2·n3 + 16·m2·x'' + 8·m22 + 56·n3 + 16·n3·x'' + 8·n32 + 56·x'' + 8·x''2 }→ if(1, 1 + n3 + (1 + m2 + x''), z'', 1 + z'' + (1 + s13 + 0)) :|: s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 3 }→ if(1, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1 }→ if(0, z', z'', 1 + z'' + (1 + 0 + 0)) :|: z' >= 0, z'' >= 0
sortIter(z', z'') -{ 105 + 57·m3 + 16·m3·n4 + 16·m3·x2 + 8·m32 + 56·n4 + 16·n4·x2 + 8·n42 + 56·x2 + 8·x22 }→ if(0, 1 + n4 + (1 + m3 + x2), z'', 1 + z'' + (1 + s14 + 0)) :|: s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 2 }→ if(0, 1 + (z' - 1) + 0, z'', 1 + z'' + (1 + (z' - 1) + 0)) :|: z' - 1 >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]
sortIter: runtime: O(n3) [252 + 2874·z' + 3556·z'2 + 1450·z'3], size: O(n2) [2·z' + z'2 + z'']
if: runtime: O(n3) [19048 + 86982·z'' + 127968·z''2 + 69600·z''3], size: O(n2) [8 + 6·z'' + z''2 + z1 + z2]

(61) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(62) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 262 + 2874·s24 + 3556·s242 + 1450·s243 }→ s45 :|: s45 >= 0, s45 <= 2 * s24 + 1 * (s24 * s24) + 1 * z2, s24 >= 0, s24 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s25 + 3556·s252 + 1450·s253 }→ s46 :|: s46 >= 0, s46 <= 2 * s25 + 1 * (s25 * s25) + 1 * z2, s25 >= 0, s25 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s26 + 3556·s262 + 1450·s263 }→ s47 :|: s47 >= 0, s47 <= 2 * s26 + 1 * (s26 * s26) + 1 * z2, s26 >= 0, s26 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 260 + 2874·s27 + 3556·s272 + 1450·s273 }→ s48 :|: s48 >= 0, s48 <= 2 * s27 + 1 * (s27 * s27) + 1 * z2, s27 >= 0, s27 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 370 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s28 + 3556·s282 + 1450·s283 + 62·x4 + 9·x42 }→ s49 :|: s49 >= 0, s49 <= 2 * s28 + 1 * (s28 * s28) + 1 * z2, s28 >= 0, s28 <= 1 * n5 + 1 * (1 + m4 + x4), s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 364 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s29 + 3556·s292 + 1450·s293 + 56·x4 + 8·x42 }→ s50 :|: s50 >= 0, s50 <= 2 * s29 + 1 * (s29 * s29) + 1 * z2, s29 >= 0, s29 <= 1 * n5 + 1 * 0, s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 369 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s30 + 3556·s302 + 1450·s303 + 62·x4 + 9·x42 }→ s51 :|: s51 >= 0, s51 <= 2 * s30 + 1 * (s30 * s30) + 1 * z2, s30 >= 0, s30 <= 1 * 0 + 1 * (1 + m4 + x4), s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 363 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s31 + 3556·s312 + 1450·s313 + 56·x4 + 8·x42 }→ s52 :|: s52 >= 0, s52 <= 2 * s31 + 1 * (s31 * s31) + 1 * z2, s31 >= 0, s31 <= 1 * 0 + 1 * 0, s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s32 + 3556·s322 + 1450·s323 + 4·x5 + x52 }→ s53 :|: s53 >= 0, s53 <= 2 * s32 + 1 * (s32 * s32) + 1 * z2, s32 >= 0, s32 <= 1 * n6 + 1 * x5, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s33 + 3556·s332 + 1450·s333 }→ s54 :|: s54 >= 0, s54 <= 2 * s33 + 1 * (s33 * s33) + 1 * z2, s33 >= 0, s33 <= 1 * n6 + 1 * 0, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s34 + 3556·s342 + 1450·s343 }→ s55 :|: s55 >= 0, s55 <= 2 * s34 + 1 * (s34 * s34) + 1 * z2, s34 >= 0, s34 <= 1 * 0 + 1 * 0, z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s35 + 3556·s352 + 1450·s353 + 4·x6 + x62 }→ s56 :|: s56 >= 0, s56 <= 2 * s35 + 1 * (s35 * s35) + 1 * z2, s35 >= 0, s35 <= 1 * 0 + 1 * x6, z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 259 + 2874·s36 + 3556·s362 + 1450·s363 }→ s57 :|: s57 >= 0, s57 <= 2 * s36 + 1 * (s36 * s36) + 1 * z2, s36 >= 0, s36 <= 1 * 0 + 1 * 0, z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 7 + 4·x + x2 }→ 1 + k + s23 :|: s23 >= 0, s23 <= 1 * z1 + 1 * x, z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s19 :|: s19 >= 0, s19 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s20 :|: s20 >= 0, s20 <= 1 * z'' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s21 :|: s21 >= 0, s21 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s22 :|: s22 >= 0, s22 <= 1 * z'' + 1 * (1 + (1 + m1) + x), s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 253 + 2874·z' + 3556·z'2 + 1450·z'3 }→ s37 :|: s37 >= 0, s37 <= 2 * z' + 1 * (z' * z') + 1 * 0, z' >= 0
sortIter(z', z'') -{ 19050 }→ s38 :|: s38 >= 0, s38 <= 6 * 0 + 8 + 1 * (0 * 0) + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z'' >= 0, z' = 0
sortIter(z', z'') -{ 19051 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s39 :|: s39 >= 0, s39 <= 6 * (1 + (z' - 1) + 0) + 8 + 1 * ((1 + (z' - 1) + 0) * (1 + (z' - 1) + 0)) + 1 * (1 + z'' + (1 + (z' - 1) + 0)) + 1 * z'', z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1261790 + 1434111·m2 + 1091152·m2·n3 + 417600·m2·n3·x'' + 208800·m2·n32 + 1091152·m2·x'' + 208800·m2·x''2 + 545576·m22 + 208800·m22·n3 + 208800·m22·x'' + 69600·m23 + 1434110·n3 + 1091152·n3·x'' + 208800·n3·x''2 + 545576·n32 + 208800·n32·x'' + 69600·n33 + 1434110·x'' + 545576·x''2 + 69600·x''3 }→ s40 :|: s40 >= 0, s40 <= 6 * (1 + n3 + (1 + m2 + x'')) + 8 + 1 * ((1 + n3 + (1 + m2 + x'')) * (1 + n3 + (1 + m2 + x''))) + 1 * (1 + z'' + (1 + s13 + 0)) + 1 * z'', s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 303600 + 551718·n3 + 673536·n3·x' + 208800·n3·x'2 + 336768·n32 + 208800·n32·x' + 69600·n33 + 551718·x' + 336768·x'2 + 69600·x'3 }→ s41 :|: s41 >= 0, s41 <= 6 * (1 + n3 + x') + 8 + 1 * ((1 + n3 + x') * (1 + n3 + x')) + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 19050 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s42 :|: s42 >= 0, s42 <= 6 * (1 + (z' - 1) + 0) + 8 + 1 * ((1 + (z' - 1) + 0) * (1 + (z' - 1) + 0)) + 1 * (1 + z'' + (1 + (z' - 1) + 0)) + 1 * z'', z' - 1 >= 0, z'' >= 0
sortIter(z', z'') -{ 1261789 + 1434111·m3 + 1091152·m3·n4 + 417600·m3·n4·x2 + 208800·m3·n42 + 1091152·m3·x2 + 208800·m3·x22 + 545576·m32 + 208800·m32·n4 + 208800·m32·x2 + 69600·m33 + 1434110·n4 + 1091152·n4·x2 + 208800·n4·x22 + 545576·n42 + 208800·n42·x2 + 69600·n43 + 1434110·x2 + 545576·x22 + 69600·x23 }→ s43 :|: s43 >= 0, s43 <= 6 * (1 + n4 + (1 + m3 + x2)) + 8 + 1 * ((1 + n4 + (1 + m3 + x2)) * (1 + n4 + (1 + m3 + x2))) + 1 * (1 + z'' + (1 + s14 + 0)) + 1 * z'', s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 19049 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s44 :|: s44 >= 0, s44 <= 6 * z' + 8 + 1 * (z' * z') + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z' >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]
sortIter: runtime: O(n3) [252 + 2874·z' + 3556·z'2 + 1450·z'3], size: O(n2) [2·z' + z'2 + z'']
if: runtime: O(n3) [19048 + 86982·z'' + 127968·z''2 + 69600·z''3], size: O(n2) [8 + 6·z'' + z''2 + z1 + z2]

(63) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: sort
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 2·z' + z'2

(64) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 262 + 2874·s24 + 3556·s242 + 1450·s243 }→ s45 :|: s45 >= 0, s45 <= 2 * s24 + 1 * (s24 * s24) + 1 * z2, s24 >= 0, s24 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s25 + 3556·s252 + 1450·s253 }→ s46 :|: s46 >= 0, s46 <= 2 * s25 + 1 * (s25 * s25) + 1 * z2, s25 >= 0, s25 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s26 + 3556·s262 + 1450·s263 }→ s47 :|: s47 >= 0, s47 <= 2 * s26 + 1 * (s26 * s26) + 1 * z2, s26 >= 0, s26 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 260 + 2874·s27 + 3556·s272 + 1450·s273 }→ s48 :|: s48 >= 0, s48 <= 2 * s27 + 1 * (s27 * s27) + 1 * z2, s27 >= 0, s27 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 370 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s28 + 3556·s282 + 1450·s283 + 62·x4 + 9·x42 }→ s49 :|: s49 >= 0, s49 <= 2 * s28 + 1 * (s28 * s28) + 1 * z2, s28 >= 0, s28 <= 1 * n5 + 1 * (1 + m4 + x4), s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 364 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s29 + 3556·s292 + 1450·s293 + 56·x4 + 8·x42 }→ s50 :|: s50 >= 0, s50 <= 2 * s29 + 1 * (s29 * s29) + 1 * z2, s29 >= 0, s29 <= 1 * n5 + 1 * 0, s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 369 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s30 + 3556·s302 + 1450·s303 + 62·x4 + 9·x42 }→ s51 :|: s51 >= 0, s51 <= 2 * s30 + 1 * (s30 * s30) + 1 * z2, s30 >= 0, s30 <= 1 * 0 + 1 * (1 + m4 + x4), s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 363 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s31 + 3556·s312 + 1450·s313 + 56·x4 + 8·x42 }→ s52 :|: s52 >= 0, s52 <= 2 * s31 + 1 * (s31 * s31) + 1 * z2, s31 >= 0, s31 <= 1 * 0 + 1 * 0, s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s32 + 3556·s322 + 1450·s323 + 4·x5 + x52 }→ s53 :|: s53 >= 0, s53 <= 2 * s32 + 1 * (s32 * s32) + 1 * z2, s32 >= 0, s32 <= 1 * n6 + 1 * x5, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s33 + 3556·s332 + 1450·s333 }→ s54 :|: s54 >= 0, s54 <= 2 * s33 + 1 * (s33 * s33) + 1 * z2, s33 >= 0, s33 <= 1 * n6 + 1 * 0, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s34 + 3556·s342 + 1450·s343 }→ s55 :|: s55 >= 0, s55 <= 2 * s34 + 1 * (s34 * s34) + 1 * z2, s34 >= 0, s34 <= 1 * 0 + 1 * 0, z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s35 + 3556·s352 + 1450·s353 + 4·x6 + x62 }→ s56 :|: s56 >= 0, s56 <= 2 * s35 + 1 * (s35 * s35) + 1 * z2, s35 >= 0, s35 <= 1 * 0 + 1 * x6, z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 259 + 2874·s36 + 3556·s362 + 1450·s363 }→ s57 :|: s57 >= 0, s57 <= 2 * s36 + 1 * (s36 * s36) + 1 * z2, s36 >= 0, s36 <= 1 * 0 + 1 * 0, z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 7 + 4·x + x2 }→ 1 + k + s23 :|: s23 >= 0, s23 <= 1 * z1 + 1 * x, z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s19 :|: s19 >= 0, s19 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s20 :|: s20 >= 0, s20 <= 1 * z'' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s21 :|: s21 >= 0, s21 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s22 :|: s22 >= 0, s22 <= 1 * z'' + 1 * (1 + (1 + m1) + x), s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 253 + 2874·z' + 3556·z'2 + 1450·z'3 }→ s37 :|: s37 >= 0, s37 <= 2 * z' + 1 * (z' * z') + 1 * 0, z' >= 0
sortIter(z', z'') -{ 19050 }→ s38 :|: s38 >= 0, s38 <= 6 * 0 + 8 + 1 * (0 * 0) + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z'' >= 0, z' = 0
sortIter(z', z'') -{ 19051 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s39 :|: s39 >= 0, s39 <= 6 * (1 + (z' - 1) + 0) + 8 + 1 * ((1 + (z' - 1) + 0) * (1 + (z' - 1) + 0)) + 1 * (1 + z'' + (1 + (z' - 1) + 0)) + 1 * z'', z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1261790 + 1434111·m2 + 1091152·m2·n3 + 417600·m2·n3·x'' + 208800·m2·n32 + 1091152·m2·x'' + 208800·m2·x''2 + 545576·m22 + 208800·m22·n3 + 208800·m22·x'' + 69600·m23 + 1434110·n3 + 1091152·n3·x'' + 208800·n3·x''2 + 545576·n32 + 208800·n32·x'' + 69600·n33 + 1434110·x'' + 545576·x''2 + 69600·x''3 }→ s40 :|: s40 >= 0, s40 <= 6 * (1 + n3 + (1 + m2 + x'')) + 8 + 1 * ((1 + n3 + (1 + m2 + x'')) * (1 + n3 + (1 + m2 + x''))) + 1 * (1 + z'' + (1 + s13 + 0)) + 1 * z'', s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 303600 + 551718·n3 + 673536·n3·x' + 208800·n3·x'2 + 336768·n32 + 208800·n32·x' + 69600·n33 + 551718·x' + 336768·x'2 + 69600·x'3 }→ s41 :|: s41 >= 0, s41 <= 6 * (1 + n3 + x') + 8 + 1 * ((1 + n3 + x') * (1 + n3 + x')) + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 19050 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s42 :|: s42 >= 0, s42 <= 6 * (1 + (z' - 1) + 0) + 8 + 1 * ((1 + (z' - 1) + 0) * (1 + (z' - 1) + 0)) + 1 * (1 + z'' + (1 + (z' - 1) + 0)) + 1 * z'', z' - 1 >= 0, z'' >= 0
sortIter(z', z'') -{ 1261789 + 1434111·m3 + 1091152·m3·n4 + 417600·m3·n4·x2 + 208800·m3·n42 + 1091152·m3·x2 + 208800·m3·x22 + 545576·m32 + 208800·m32·n4 + 208800·m32·x2 + 69600·m33 + 1434110·n4 + 1091152·n4·x2 + 208800·n4·x22 + 545576·n42 + 208800·n42·x2 + 69600·n43 + 1434110·x2 + 545576·x22 + 69600·x23 }→ s43 :|: s43 >= 0, s43 <= 6 * (1 + n4 + (1 + m3 + x2)) + 8 + 1 * ((1 + n4 + (1 + m3 + x2)) * (1 + n4 + (1 + m3 + x2))) + 1 * (1 + z'' + (1 + s14 + 0)) + 1 * z'', s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 19049 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s44 :|: s44 >= 0, s44 <= 6 * z' + 8 + 1 * (z' * z') + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z' >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed: {sort}
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]
sortIter: runtime: O(n3) [252 + 2874·z' + 3556·z'2 + 1450·z'3], size: O(n2) [2·z' + z'2 + z'']
if: runtime: O(n3) [19048 + 86982·z'' + 127968·z''2 + 69600·z''3], size: O(n2) [8 + 6·z'' + z''2 + z1 + z2]
sort: runtime: ?, size: O(n2) [2·z' + z'2]

(65) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: sort
after applying outer abstraction to obtain an ITS,
resulting in: O(n3) with polynomial bound: 253 + 2874·z' + 3556·z'2 + 1450·z'3

(66) Obligation:

Complexity RNTS consisting of the following rules:

empty(z') -{ 1 }→ 2 :|: z' = 0
empty(z') -{ 1 }→ 1 :|: n >= 0, z' = 1 + n + x, x >= 0
empty(z') -{ 0 }→ 0 :|: z' >= 0
eq(z', z'') -{ 1 + z'' }→ s6 :|: s6 >= 0, s6 <= 2, z' - 1 >= 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 2 :|: z'' = 0, z' = 0
eq(z', z'') -{ 1 }→ 1 :|: z' = 0, z'' - 1 >= 0
eq(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
head(z') -{ 1 }→ n :|: n >= 0, z' = 1 + n + x, x >= 0
head(z') -{ 0 }→ 0 :|: z' >= 0
if(z', z'', z1, z2) -{ 262 + 2874·s24 + 3556·s242 + 1450·s243 }→ s45 :|: s45 >= 0, s45 <= 2 * s24 + 1 * (s24 * s24) + 1 * z2, s24 >= 0, s24 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s25 + 3556·s252 + 1450·s253 }→ s46 :|: s46 >= 0, s46 <= 2 * s25 + 1 * (s25 * s25) + 1 * z2, s25 >= 0, s25 <= 1 * (z'' - 1) + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s26 + 3556·s262 + 1450·s263 }→ s47 :|: s47 >= 0, s47 <= 2 * s26 + 1 * (s26 * s26) + 1 * z2, s26 >= 0, s26 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 260 + 2874·s27 + 3556·s272 + 1450·s273 }→ s48 :|: s48 >= 0, s48 <= 2 * s27 + 1 * (s27 * s27) + 1 * z2, s27 >= 0, s27 <= 1 * 0 + 1 * 0, z2 >= 0, z1 >= 0, z' = 1, z'' - 1 >= 0
if(z', z'', z1, z2) -{ 370 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s28 + 3556·s282 + 1450·s283 + 62·x4 + 9·x42 }→ s49 :|: s49 >= 0, s49 <= 2 * s28 + 1 * (s28 * s28) + 1 * z2, s28 >= 0, s28 <= 1 * n5 + 1 * (1 + m4 + x4), s15 >= 0, s15 <= 1 * (1 + n5 + (1 + m4 + x4)), s2 >= 0, s2 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 364 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s29 + 3556·s292 + 1450·s293 + 56·x4 + 8·x42 }→ s50 :|: s50 >= 0, s50 <= 2 * s29 + 1 * (s29 * s29) + 1 * z2, s29 >= 0, s29 <= 1 * n5 + 1 * 0, s16 >= 0, s16 <= 1 * (1 + n5 + (1 + m4 + x4)), s3 >= 0, s3 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 369 + 63·m4 + 16·m4·n5 + 18·m4·x4 + 9·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s30 + 3556·s302 + 1450·s303 + 62·x4 + 9·x42 }→ s51 :|: s51 >= 0, s51 <= 2 * s30 + 1 * (s30 * s30) + 1 * z2, s30 >= 0, s30 <= 1 * 0 + 1 * (1 + m4 + x4), s17 >= 0, s17 <= 1 * (1 + n5 + (1 + m4 + x4)), s4 >= 0, s4 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 363 + 57·m4 + 16·m4·n5 + 16·m4·x4 + 8·m42 + 56·n5 + 16·n5·x4 + 8·n52 + 2874·s31 + 3556·s312 + 1450·s313 + 56·x4 + 8·x42 }→ s52 :|: s52 >= 0, s52 <= 2 * s31 + 1 * (s31 * s31) + 1 * z2, s31 >= 0, s31 <= 1 * 0 + 1 * 0, s18 >= 0, s18 <= 1 * (1 + n5 + (1 + m4 + x4)), s5 >= 0, s5 <= 2, x4 >= 0, z2 >= 0, z1 >= 0, z'' = 1 + n5 + (1 + m4 + x4), n5 >= 0, z' = 1, m4 >= 0
if(z', z'', z1, z2) -{ 261 + 2874·s32 + 3556·s322 + 1450·s323 + 4·x5 + x52 }→ s53 :|: s53 >= 0, s53 <= 2 * s32 + 1 * (s32 * s32) + 1 * z2, s32 >= 0, s32 <= 1 * n6 + 1 * x5, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s33 + 3556·s332 + 1450·s333 }→ s54 :|: s54 >= 0, s54 <= 2 * s33 + 1 * (s33 * s33) + 1 * z2, s33 >= 0, s33 <= 1 * n6 + 1 * 0, x5 >= 0, z2 >= 0, n6 >= 0, z1 >= 0, z'' = 1 + n6 + x5, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s34 + 3556·s342 + 1450·s343 }→ s55 :|: s55 >= 0, s55 <= 2 * s34 + 1 * (s34 * s34) + 1 * z2, s34 >= 0, s34 <= 1 * 0 + 1 * 0, z'' = 0, z2 >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 260 + 2874·s35 + 3556·s352 + 1450·s353 + 4·x6 + x62 }→ s56 :|: s56 >= 0, s56 <= 2 * s35 + 1 * (s35 * s35) + 1 * z2, s35 >= 0, s35 <= 1 * 0 + 1 * x6, z2 >= 0, z'' = 1 + n7 + x6, n7 >= 0, z1 >= 0, x6 >= 0, z' = 1
if(z', z'', z1, z2) -{ 259 + 2874·s36 + 3556·s362 + 1450·s363 }→ s57 :|: s57 >= 0, s57 <= 2 * s36 + 1 * (s36 * s36) + 1 * z2, s36 >= 0, s36 <= 1 * 0 + 1 * 0, z2 >= 0, z'' >= 0, z1 >= 0, z' = 1
if(z', z'', z1, z2) -{ 1 }→ z1 :|: z2 >= 0, z' = 2, z'' >= 0, z1 >= 0
if_min(z', z'') -{ 11 + 6·n + 2·n·x + n2 + 6·x + x2 }→ s11 :|: s11 >= 0, s11 <= 1 * (1 + n + x), z'' = 1 + n + (1 + m + x), n >= 0, z' = 2, x >= 0, m >= 0
if_min(z', z'') -{ 11 + 6·m + 2·m·x + m2 + 6·x + x2 }→ s12 :|: s12 >= 0, s12 <= 1 * (1 + m + x), z'' = 1 + n + (1 + m + x), n >= 0, x >= 0, z' = 1, m >= 0
if_min(z', z'') -{ 0 }→ 0 :|: z' >= 0, z'' >= 0
if_replace(z', z'', z1, z2) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0, z2 >= 0
if_replace(z', z'', z1, z2) -{ 7 + 4·x + x2 }→ 1 + k + s23 :|: s23 >= 0, s23 <= 1 * z1 + 1 * x, z'' >= 0, z2 = 1 + k + x, x >= 0, z' = 1, k >= 0, z1 >= 0
if_replace(z', z'', z1, z2) -{ 1 }→ 1 + z1 + x :|: z'' >= 0, z' = 2, z2 = 1 + k + x, x >= 0, k >= 0, z1 >= 0
le(z', z'') -{ 1 + z'' }→ s :|: s >= 0, s <= 2, z' - 1 >= 0, z'' - 1 >= 0
le(z', z'') -{ 1 }→ 2 :|: z' = 0, z'' >= 0
le(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' - 1 >= 0
min(z') -{ 249 + 89·m' + 16·m'·n'' + 16·m'·x + 8·m'2 + 88·n'' + 16·n''·x + 8·n''2 + 88·x + 8·x2 }→ s10 :|: s10 >= 0, s10 <= 1 * (1 + (1 + n'') + (1 + (1 + m') + x)), s' >= 0, s' <= 2, z' = 1 + (1 + n'') + (1 + (1 + m') + x), x >= 0, m' >= 0, n'' >= 0
min(z') -{ 104 + 56·m + 16·m·x + 8·m2 + 56·x + 8·x2 }→ s8 :|: s8 >= 0, s8 <= 1 * (1 + 0 + (1 + m + x)), x >= 0, z' = 1 + 0 + (1 + m + x), m >= 0
min(z') -{ 168 + 72·n' + 16·n'·x + 8·n'2 + 72·x + 8·x2 }→ s9 :|: s9 >= 0, s9 <= 1 * (1 + (1 + n') + (1 + 0 + x)), z' = 1 + (1 + n') + (1 + 0 + x), x >= 0, n' >= 0
min(z') -{ 0 }→ 0 :|: z' >= 0
min(z') -{ 1 }→ z' - 1 :|: z' - 1 >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s19 :|: s19 >= 0, s19 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 22 + 8·m'' + 2·m''·x + m''2 + 8·x + x2 }→ s20 :|: s20 >= 0, s20 <= 1 * z'' + 1 * (1 + (1 + m'') + x), m'' >= 0, x >= 0, z1 = 1 + (1 + m'') + x, z' = 0, z'' >= 0
replace(z', z'', z1) -{ 10 + 4·z1 + z12 }→ s21 :|: s21 >= 0, s21 <= 1 * z'' + 1 * (1 + 0 + (z1 - 1)), z1 - 1 >= 0, z' - 1 >= 0, z'' >= 0
replace(z', z'', z1) -{ 23 + 9·m1 + 2·m1·x + m12 + 8·x + x2 }→ s22 :|: s22 >= 0, s22 <= 1 * z'' + 1 * (1 + (1 + m1) + x), s7 >= 0, s7 <= 2, x >= 0, z' - 1 >= 0, m1 >= 0, z1 = 1 + (1 + m1) + x, z'' >= 0
replace(z', z'', z1) -{ 1 }→ 0 :|: z' >= 0, z1 = 0, z'' >= 0
replace(z', z'', z1) -{ 0 }→ 0 :|: z' >= 0, z'' >= 0, z1 >= 0
sort(z') -{ 253 + 2874·z' + 3556·z'2 + 1450·z'3 }→ s37 :|: s37 >= 0, s37 <= 2 * z' + 1 * (z' * z') + 1 * 0, z' >= 0
sortIter(z', z'') -{ 19050 }→ s38 :|: s38 >= 0, s38 <= 6 * 0 + 8 + 1 * (0 * 0) + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z'' >= 0, z' = 0
sortIter(z', z'') -{ 19051 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s39 :|: s39 >= 0, s39 <= 6 * (1 + (z' - 1) + 0) + 8 + 1 * ((1 + (z' - 1) + 0) * (1 + (z' - 1) + 0)) + 1 * (1 + z'' + (1 + (z' - 1) + 0)) + 1 * z'', z'' >= 0, z' - 1 >= 0
sortIter(z', z'') -{ 1261790 + 1434111·m2 + 1091152·m2·n3 + 417600·m2·n3·x'' + 208800·m2·n32 + 1091152·m2·x'' + 208800·m2·x''2 + 545576·m22 + 208800·m22·n3 + 208800·m22·x'' + 69600·m23 + 1434110·n3 + 1091152·n3·x'' + 208800·n3·x''2 + 545576·n32 + 208800·n32·x'' + 69600·n33 + 1434110·x'' + 545576·x''2 + 69600·x''3 }→ s40 :|: s40 >= 0, s40 <= 6 * (1 + n3 + (1 + m2 + x'')) + 8 + 1 * ((1 + n3 + (1 + m2 + x'')) * (1 + n3 + (1 + m2 + x''))) + 1 * (1 + z'' + (1 + s13 + 0)) + 1 * z'', s13 >= 0, s13 <= 1 * (1 + n3 + (1 + m2 + x'')), s'' >= 0, s'' <= 2, z'' >= 0, x'' >= 0, m2 >= 0, n3 >= 0, z' = 1 + n3 + (1 + m2 + x'')
sortIter(z', z'') -{ 303600 + 551718·n3 + 673536·n3·x' + 208800·n3·x'2 + 336768·n32 + 208800·n32·x' + 69600·n33 + 551718·x' + 336768·x'2 + 69600·x'3 }→ s41 :|: s41 >= 0, s41 <= 6 * (1 + n3 + x') + 8 + 1 * ((1 + n3 + x') * (1 + n3 + x')) + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z' = 1 + n3 + x', x' >= 0, z'' >= 0, n3 >= 0
sortIter(z', z'') -{ 19050 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s42 :|: s42 >= 0, s42 <= 6 * (1 + (z' - 1) + 0) + 8 + 1 * ((1 + (z' - 1) + 0) * (1 + (z' - 1) + 0)) + 1 * (1 + z'' + (1 + (z' - 1) + 0)) + 1 * z'', z' - 1 >= 0, z'' >= 0
sortIter(z', z'') -{ 1261789 + 1434111·m3 + 1091152·m3·n4 + 417600·m3·n4·x2 + 208800·m3·n42 + 1091152·m3·x2 + 208800·m3·x22 + 545576·m32 + 208800·m32·n4 + 208800·m32·x2 + 69600·m33 + 1434110·n4 + 1091152·n4·x2 + 208800·n4·x22 + 545576·n42 + 208800·n42·x2 + 69600·n43 + 1434110·x2 + 545576·x22 + 69600·x23 }→ s43 :|: s43 >= 0, s43 <= 6 * (1 + n4 + (1 + m3 + x2)) + 8 + 1 * ((1 + n4 + (1 + m3 + x2)) * (1 + n4 + (1 + m3 + x2))) + 1 * (1 + z'' + (1 + s14 + 0)) + 1 * z'', s14 >= 0, s14 <= 1 * (1 + n4 + (1 + m3 + x2)), s1 >= 0, s1 <= 2, n4 >= 0, z'' >= 0, z' = 1 + n4 + (1 + m3 + x2), x2 >= 0, m3 >= 0
sortIter(z', z'') -{ 19049 + 86982·z' + 127968·z'2 + 69600·z'3 }→ s44 :|: s44 >= 0, s44 <= 6 * z' + 8 + 1 * (z' * z') + 1 * (1 + z'' + (1 + 0 + 0)) + 1 * z'', z' >= 0, z'' >= 0
tail(z') -{ 1 }→ x :|: n >= 0, z' = 1 + n + x, x >= 0
tail(z') -{ 1 }→ 0 :|: z' = 0
tail(z') -{ 0 }→ 0 :|: z' >= 0

Function symbols to be analyzed:
Previous analysis results are:
empty: runtime: O(1) [1], size: O(1) [2]
le: runtime: O(n1) [1 + z''], size: O(1) [2]
eq: runtime: O(n1) [1 + z''], size: O(1) [2]
tail: runtime: O(1) [1], size: O(n1) [z']
head: runtime: O(1) [1], size: O(n1) [z']
min: runtime: O(n2) [5 + 4·z' + z'2], size: O(n1) [z']
if_min: runtime: O(n2) [22 + 24·z'' + 8·z''2], size: O(n1) [z'']
replace: runtime: O(n2) [6 + 4·z1 + z12], size: O(n1) [z'' + z1]
if_replace: runtime: O(n2) [8 + 4·z2 + z22], size: O(n1) [z1 + z2]
sortIter: runtime: O(n3) [252 + 2874·z' + 3556·z'2 + 1450·z'3], size: O(n2) [2·z' + z'2 + z'']
if: runtime: O(n3) [19048 + 86982·z'' + 127968·z''2 + 69600·z''3], size: O(n2) [8 + 6·z'' + z''2 + z1 + z2]
sort: runtime: O(n3) [253 + 2874·z' + 3556·z'2 + 1450·z'3], size: O(n2) [2·z' + z'2]

(67) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(68) BOUNDS(1, n^3)